﻿using System;
using System.Windows;
using System.Windows.Controls;
using Caliburn.Micro;

namespace CCWP7.CaliburnMicro
{
    public class SetVisualState : IResult
    {
        readonly string _state;
        public SetVisualState(string state)
        {
            _state = state;
        }

        public void Execute(ActionExecutionContext context)
        {
            VisualStateManager.GoToState((Control)context.View, _state, true);

            Completed(this, new ResultCompletionEventArgs());
        }

        public event EventHandler<ResultCompletionEventArgs> Completed = delegate
        {
        };
    }
}
